﻿namespace Base.Entities.Enums
{
    public class EnumItem<T>
    {
        /// <summary>
        /// 枚举项
        /// </summary>
        public T Item { get; }

        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; }

        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="item"></param>
        /// <param name="alias"></param>
        public EnumItem(T item, string alias)
        {
            Item = item;
            Description = alias;
        }

        /// <summary>
        /// 获取说明
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Description ?? Item.ToString();
        }
    }
}
